package com.sh.data.engine.domain.authority.model.domain;

import com.sh.data.engine.domain.base.model.BaseDomain;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.util.LinkedHashMap;
import java.util.List;

/**
 * @author tinglan.ys @Title: @Package: @Description:
 * @date 2022/1/7 下午4:27
 */
@Data
@SuperBuilder
@NoArgsConstructor
public class UserAuthDomain extends BaseDomain {

    private String userId;

    // key就是空间id
    /**
     * 空间权限信息
     */
    private LinkedHashMap<Long, List<TblAuth>> projectTblAuthMap;

    @Data
    public static class TblAuth {

        // 有些数据源有tblId
        private Long tblId;

        // 有些数据源只有tableName 比如hive
        private String tableName;

        /**
         * 0-只读 1或者null—读写 2-无读写权限
         */
        private String auth;

        /**
         * 字符串类型的tblId
         */
        private String tblIdStr;
    }
}
